package edu.jhu.tcj.purfuit;

/**
 * 
 * @author Brad Gabrielse
 *
 */
public class Die {

	/** Maximum value on the die */
	private final int maxValue;

	/** Value of the die */
	private int value = 3;
	
	/** 
	 * Creates a die with values from 1 to the maxValue
	 * @param maxValue the maximum value on the die
	 */
	public Die(int maxValue) {
		this.maxValue = maxValue;
	}
	
	/**
	 * Roll the die
	 * @return the number from the die
	 */
	public int roll() {
		value = (int)Math.ceil(Math.random()*maxValue);
		return value;
	}
	
	/** 
	 * Get the current value of the die
	 * @return
	 */
	public int getValue() {
		return value;
	}
	
}
